{% extends base %}

{% block body_top %}

    <div class="card">
        <div class="card-title">
            <span>修改密码</span>
            
            <div class="float-right">
                {% include common/button/back_button.html %}
            </div>

        </div>
    </div>


    <div class="card">
        {% if error != "" %}
            <div class="error">
                {{error}}
            </div>
        {% end %}

        <form action="" method="POST">
            <div class="input-group row">
                <label>账号名:</label>
                <span>{{_user_name}}</span>
            </div>
            
            <div class="input-group row">
                <label>旧的密码:</label>
                <input type="password" name="old_password" value="{{old_password}}">
            </div>

            <div class="input-group row">
                <label>新的密码:</label>
                <input type="password" name="new_password" value="{{new_password}}">
            </div>

            <div class="input-group row">
                <label>&nbsp;</label>
                <input type="submit" value="确认修改"/>
            </div>
        </form>
    </div>

{% if not _has_login %}
    <script type="text/javascript">
        $(function () {
            xnote.toast("修改密码成功，正在跳转登录");
            setTimeout(function () {
                window.location.href = "/login";
            }, 1000);
        });
    </script>
{% end %}

{% end %}